#pragma once

#include <iostream>
#include <Windows.h>
#include <atlstr.h>
#include <vector>
#include <map>

class CFileCat
{
	//function delcare
	typedef bool (*ResponseFun)(void*, const CStringA&);

public:
	CFileCat(void);
	~CFileCat(void);

	void InitCmdSet();
	bool CheckCmdValid(const CStringA& strCmd);
	bool AddCmd(const CStringA& strCmd, const CStringA& strValue);

	static bool ProcessOpenOfile(void*, const CStringA& );
	static bool ProcessIfileS(void*, const CStringA& );
	static bool ProcessIfileA(void*, const CStringA& );
	static bool ProcessOffset(void*, const CStringA& );
	bool DoProcess();
	bool DoProcessEnd();

protected:
	static bool CopyFile( HANDLE hDestFile, HANDLE hSourceFile );

private:
	std::vector<std::pair<CStringA, ResponseFun>> m_vecValidCmd;
	std::map<CStringA, CStringA> m_mapUserCmd;

	HANDLE m_hFileOut;
};
